#!/bin/sh

TOMCAT_NAME='tomcat'

MONITER_NAME='monitorTomcat.sh'

time=`date +%F--%T`

#remote_host=172.18.13.101

remote_host=$1

remote_path=/szcg/WizdomCloudUrban/szcg

src_path=/szcg/WizdomCloudUrban/updatefile/szcg/*



ssh root@${remote_host}  << remotessh

#/szcg/tool/updateRemote/updateSystem_stop.sh
ls
exit
remotessh

echo '复制更新文件到服务器'$remote_host


scp -r $src_path root@${remote_host}:${remote_path}

echo '开始远程启动' 


ssh root@${remote_host}  << remotessh

#/szcg/tool/updateRemote/updateSystem_start.sh
echo 'second'

cd /szcg/tool/
nohup ./monitorTomcat.sh >/szcg/tool/monitorTomcat.out

echo 'done'

exit
remotessh
